from skimage.metrics import peak_signal_noise_ratio as psnr
from skimage.metrics import structural_similarity as ssim
from PIL import Image
import numpy as np

img_cubic  = np.array(Image.open('./contrast/x_CUBIC_resized.png'))
img_resnet = np.array(Image.open('./contrast/resnet.jpg'))
img_gan    = np.array(Image.open('./contrast/gan.jpg'))
img_pred   = np.array(Image.open('./contrast/x_preds.png'))
img_same   = np.array(Image.open('./contrast/x_preds_same_frame.png'))
img_y      = np.array(Image.open('./contrast/y.png'))

print('cubic_psnr:',psnr(img_y,img_cubic))
print('cubic_ssim:',ssim(img_y,img_cubic,multichannel=True))

print('resnet_psnr:',psnr(img_y,img_resnet))
print('resnet_ssim:',ssim(img_y,img_resnet,multichannel=True))

print('gan_psnr:',psnr(img_y,img_gan))
print('gan_ssim:',ssim(img_y,img_gan,multichannel=True))

print('same_psnr:',psnr(img_y,img_same))
print('same_ssim:',ssim(img_y,img_same,multichannel=True))

print('pred_psnr:',psnr(img_y,img_pred))
print('pred_ssim:',ssim(img_y,img_pred,multichannel=True))
